import java.util.Arrays;

class lk12101 {
    public static void main(String[] args) {
        String[] strs = new String[]{"alic3","bob","3","4","00000"};
        int n = strs.length;
        int max=0;
        /*for(int i=0;i<n;i++){
            int m = strs[i].length();
            int c=0;
            max=0;
            for(int j=0;j<m;j++){
                if(strs[i].charAt(j)>='0'&&strs[i].charAt(j)<='9'){
                    c++;
                }
                if(c!=0&&strs[i].charAt(j)<'0'||strs[i].charAt(j)>'9'){
                    String s1 = strs[i].substring(j-c, j);
                    Integer end = Integer.parseInt(s1);
                    max=Math.max(max, end);
                }
            }
            if(c!=m){
                max=Math.max(m, max);
            }
        }
        System.out.println(max);*/
        for(int i=0;i<n;i++){
            int m = strs[i].length();
            int c=0;
            for(int j=0;j<m;j++){
                if(strs[i].charAt(j)>='0'&&strs[i].charAt(j)<='9'){
                    c++;
                }
                if(c==m-1){
                    Integer end = Integer.parseInt(strs[i]);
                    max=Math.max(end, max);
                }
                if(c==j){
                    max=Math.max(m, max);
                    break;
                }
            }
        }
        System.out.println(max);

    }
}